/**
 * Created by sun.kang on 14-5-27.
 */
var GameOverLayer = cc.LayerColor.extend({
    ctor: function() {
        this._super();
        this.init();
    },

    init: function() {
        this._super(new cc.Color(0,0,0, 180));
        var winSize = cc.director.getWinSize();
        var centerPos = cc.p(winSize.width / 2, winSize.height / 2);
        cc.MenuItemFont.setFontSize(30);
        var menuItemRestart = cc.MenuItemSprite.create(
            cc.Sprite.create(res.ReStartN_png),
            cc.Sprite.create(res.ReStartS_png),
            null,
            this.onRestart, this
        );
        var menu = cc.Menu.create(menuItemRestart);
        menu.setPosition(centerPos);
        this.addChild(menu);
    },

    onRestart: function(sender) {
        cc.director.resume();
        cc.director.runScene(new GamePlayScene());
    }
});